{% extends 'layouts/base.html' %}
{% block content %}
<div class="row">
    <div class="col-xs-12">
        <!-- PAGE CONTENT BEGINS -->
        <form action="{{ url('backend/yaforder/edit', {id:yaforder.id}) }}" class="form-horizontal" role="form" method="post" enctype="multipart/form-data">

            <div class="form-group{% if errors['order_number'] is not empty %} has-error{%endif%}">
                <label for="order_number" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">订单号</label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="order_number" placeholder="订单号" name="order_number" class="col-xs-12" value="{{yaforder.order_number}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['order_number'] is not empty %}{{errors['order_number']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['carry_type'] is not empty %} has-error{%endif%}">
                <label for="carry_type" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">搬家业务<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="carry_type" placeholder="搬家业务" name="carry_type" class="col-xs-12" value="{{yaforder.carry_type}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['carry_type'] is not empty %}{{errors['carry_type']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['client_type'] is not empty %} has-error{%endif%}">
                <label for="client_type" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">C个人，Q企业 Z政府 O其他<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="client_type" placeholder="C个人，Q企业 Z政府 O其他" name="client_type" class="col-xs-12" value="{{yaforder.client_type}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['client_type'] is not empty %}{{errors['client_type']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['client'] is not empty %} has-error{%endif%}">
                <label for="client" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">联系人<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="client" placeholder="联系人" name="client" class="col-xs-12" value="{{yaforder.client}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['client'] is not empty %}{{errors['client']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['mobile'] is not empty %} has-error{%endif%}">
                <label for="mobile" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">手机<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="mobile" placeholder="手机" name="mobile" class="col-xs-12" value="{{yaforder.mobile}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['mobile'] is not empty %}{{errors['mobile']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['start_address'] is not empty %} has-error{%endif%}">
                <label for="start_address" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">出发地址<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="start_address" placeholder="出发地址" name="start_address" class="col-xs-12" value="{{yaforder.start_address}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['start_address'] is not empty %}{{errors['start_address']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['arrive_address'] is not empty %} has-error{%endif%}">
                <label for="arrive_address" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">到达地址<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="arrive_address" placeholder="到达地址" name="arrive_address" class="col-xs-12" value="{{yaforder.arrive_address}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['arrive_address'] is not empty %}{{errors['arrive_address']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['scg_id'] is not empty %} has-error{%endif%}">
                <label for="scg_id" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">附加费id<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="scg_id" placeholder="附加费id" name="scg_id" class="col-xs-12" value="{{yaforder.scg_id}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['scg_id'] is not empty %}{{errors['scg_id']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['item_id'] is not empty %} has-error{%endif%}">
                <label for="item_id" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">大件物品id<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="item_id" placeholder="大件物品id" name="item_id" class="col-xs-12" value="{{yaforder.item_id}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['item_id'] is not empty %}{{errors['item_id']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['fm_id'] is not empty %} has-error{%endif%}">
                <label for="fm_id" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">领班人员<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="fm_id" placeholder="领班人员" name="fm_id" class="col-xs-12" value="{{yaforder.fm_id}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['fm_id'] is not empty %}{{errors['fm_id']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['m_id'] is not empty %} has-error{%endif%}">
                <label for="m_id" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">车辆配备<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="m_id" placeholder="车辆配备" name="m_id" class="col-xs-12" value="{{yaforder.m_id}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['m_id'] is not empty %}{{errors['m_id']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['carrydate'] is not empty %} has-error{%endif%}">
                <label for="carrydate" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">搬运日期<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="carrydate" placeholder="搬运日期" name="carrydate" class="col-xs-12" value="{{yaforder.carrydate}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['carrydate'] is not empty %}{{errors['carrydate']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['is_bill'] is not empty %} has-error{%endif%}">
                <label for="is_bill" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">1开发票 0不开<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="is_bill" placeholder="1开发票 0不开" name="is_bill" class="col-xs-12" value="{{yaforder.is_bill}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['is_bill'] is not empty %}{{errors['is_bill']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['total_price'] is not empty %} has-error{%endif%}">
                <label for="total_price" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">总共价格<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="total_price" placeholder="总共价格" name="total_price" class="col-xs-12" value="{{yaforder.total_price}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['total_price'] is not empty %}{{errors['total_price']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['already_price'] is not empty %} has-error{%endif%}">
                <label for="already_price" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">已支付价格<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="already_price" placeholder="已支付价格" name="already_price" class="col-xs-12" value="{{yaforder.already_price}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['already_price'] is not empty %}{{errors['already_price']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['order_state'] is not empty %} has-error{%endif%}">
                <label for="order_state" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">订单状态 0未处理，1进行中，2等待支付预约金，3完成<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="order_state" placeholder="订单状态 0未处理，1进行中，2等待支付预约金，3完成" name="order_state" class="col-xs-12" value="{{yaforder.order_state}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['order_state'] is not empty %}{{errors['order_state']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['createtime'] is not empty %} has-error{%endif%}">
                <label for="createtime" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">创建日期<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="createtime" placeholder="创建日期" name="createtime" class="col-xs-12" value="{{yaforder.createtime}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['createtime'] is not empty %}{{errors['createtime']}}{% else %} {%endif%} </div>
            </div>



            <div class="clearfix form-actions">
                <div class="col-md-offset-3 col-md-9">
                    <button class="btn btn-info" type="submit">
                        <i class="ace-icon fa fa-check bigger-110"></i>
                        提交
                    </button>

                    &nbsp; &nbsp; &nbsp;
                    <a class="btn" href="javascript:;" onclick="history.back(); ">
                        <i class="ace-icon fa fa-undo bigger-110"></i>
                        返回
                    </a>
                </div>
            </div>

        </form>
    </div><!-- /.col -->
</div><!-- /.row -->
{% endblock %}
{% block script %}

<script type="text/javascript">
    $(document).ready(function(){

        $(".ace-switch").each(function () {
            var aceswitch = this;

            aceswitch.addEventListener("click", function(){
                id = this.id.replace("_radio", "");
                if(this.checked){
                    $("#"+id).val('1');
                } else {
                    $("#"+id).val('0');
                }
                });
        });
    });
</script>
{% endblock %}
